'''
5
1 1 2 1 2
3
0 1 2 0 0
0 0 0 0 0
1 2 2 0 2
'''

x = int(input())
hat_list = list(map(int, input().split()))
hat_list2 = None
xx = int(input())
if xx>0:
    for i in range(xx):
        hat_list2 = list(map(int, input().split()))
        if hat_list2.count(0) == len(hat_list2):
            print('Ai Ya')
        else:
            for j in range(len(hat_list)):
                if hat_list2[j] == 0:
                    hat_list2[j] = hat_list[j]
            if sum(hat_list2) == sum(hat_list):
                print('Da Jiang!!!')
            else:
                print('Ai Ya')

